package com.jixin.core;

import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;

public class HttpClientHelper {
	public static final int ConnectionTimeOut = 2*1000;
	public static final int SocketTimeout = 2*1000;
	public static final int ConnectionRequestTimeout = 5*100;
	private static final PoolingHttpClientConnectionManager pool = new PoolingHttpClientConnectionManager();
	
	
	static{
		pool.setMaxTotal(20000);
		pool.setDefaultMaxPerRoute(5000);
	}
	
	private final static CloseableHttpClient httpClient = HttpClients.custom()
			.setConnectionManager(pool).build();
	
	
	public static CloseableHttpClient getClient()
	{
		return HttpClientHelper.httpClient;
	}
}